﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace LowLevelGraphics.ImageFormats.SVG.Shapes
{
    /// <summary>
    /// Path
    /// </summary>
    public class Path : Shape
    {
        protected GraphicsPath m_GraphicsPath = null;

        /// <summary>
        /// Initializes a new instance of the <see cref="Path"/> class.
        /// </summary>
        public Path()
        {
            m_Style.FillColor = Color.Black;
            m_Style.StrokeColor = Color.Black;
        }

        /// <summary>
        /// Draws the specified g.
        /// </summary>
        /// <param name="g">The g.</param>
        public override void Draw(Graphics g)
        {
            Brush brush = new SolidBrush(Style.FillColor);
            Pen pen = new Pen(new SolidBrush(Style.StrokeColor), Style.StrokeWidth);
            g.FillPath(brush, m_GraphicsPath);
            g.DrawPath(pen, m_GraphicsPath);
            pen.Dispose();
            brush.Dispose();
        }

        /// <summary>
        /// Gets or sets the graphics path.
        /// </summary>
        /// <value>The graphics path.</value>
        internal GraphicsPath GraphicsPath
        {
            get { return m_GraphicsPath; }
            set { m_GraphicsPath = value; }
        }
    }
}
